//==================================================================
//  Copyright (C) 2006  Davide Pasca
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//==================================================================
///
///
///
///
///
//==================================================================

#ifndef SHADOWTASK_H
#define SHADOWTASK_H

#include "rend_system.h"
#include "rendm5d.h"

//==================================================================
///
//==================================================================
class ShadowTask
{
	RendDevice			*_RDevice;
	RendM5D::Scene		*_RScenep;

	RendTarget			*_OffscrTarget;
	M5D::Camera			*_LightCamerap;

	float				_NearZ;
	float				_FarZ;

	PMath::Matrix44		_last_lproj_world_m;
	PMath::Matrix44		_last_world_vproj_m;

public:
	ShadowTask( RendDevice *RDevice, RendM5D::Scene *RScenep, float NearZ, float FarZ );
	
	void	RenderLightView( M5D::Light *lightp );

	RendTarget	*GetRendTarget()
	{
		return _OffscrTarget;
	}

	M5D::Camera	*GetLightCamera()
	{
		return _LightCamerap;
	}

};



#endif